package com.main;

import com.util.GameUtil;

import java.awt.*;
import java.awt.image.BufferedImage;
import java.util.ArrayList;
import java.util.List;

public class GameFrontGround {
//    云彩的个数
    private static final int CLOUD_COUNT = 2;
//    存放云彩的容器
    private List<Cloud> clouds;
//    云彩的飞行速度
    private static final int CLOUD_SPEED = 1;
//    使用的图片资源
    private BufferedImage[] img;

//    构造器初始化数据

    public GameFrontGround() {
        clouds = new ArrayList<>();
        img = new BufferedImage[CLOUD_COUNT];

//        容器中添加云彩的图片
        for (int i = 0; i < CLOUD_COUNT; i++) {
            img[i] = GameUtil.loadBufferedImage("img/cloud0.png");
        }
    }

//    绘制云彩
    public void draw(Graphics g){
        Cloud cloud = new Cloud(img[1],CLOUD_SPEED,300,300);
        clouds.add(cloud);
        clouds.get(0).draw(g);
    }
}
